import request from '@/config/axios'

// 就业文章 VO
export interface EmploymentEssayVO {
  id: number // 主键id
  name: string // 名称
  schoolId: string // 对口院校id
  schoolName: string // 对口院校名称
  content: string // 文章内容
  status: number // 状态
  sort: number // 排序
}

// 就业文章 API
export const EmploymentEssayApi = {
  // 查询就业文章分页
  getEmploymentEssayPage: async (params: any) => {
    return await request.get({ url: `/kf/employment-essay/page`, params })
  },

  // 查询就业文章详情
  getEmploymentEssay: async (id: number) => {
    return await request.get({ url: `/kf/employment-essay/get?id=` + id })
  },

  // 新增就业文章
  createEmploymentEssay: async (data: EmploymentEssayVO) => {
    return await request.post({ url: `/kf/employment-essay/create`, data })
  },

  // 修改就业文章
  updateEmploymentEssay: async (data: EmploymentEssayVO) => {
    return await request.put({ url: `/kf/employment-essay/update`, data })
  },

  // 删除就业文章
  deleteEmploymentEssay: async (id: number) => {
    return await request.delete({ url: `/kf/employment-essay/delete?id=` + id })
  },

  // 导出就业文章 Excel
  exportEmploymentEssay: async (params) => {
    return await request.download({ url: `/kf/employment-essay/export-excel`, params })
  },
}